The size of the secure image does not include the size of the
header, subtract this out before we move the image or we grab
extra data after the image.
Signed-off-by: Andrew F. Davis <[email protected]>
Reviewed-by: Lokesh Vutla <[email protected]>
}
/*
- * Overwrite the image headers after authentication
- * and decryption. Update size to reflect removal
- * of header.
- */
- memcpy(image, image + KS2_HS_SEC_HEADER_LEN, *p_size);
+ * Overwrite the image headers after authentication
+ * and decryption. Update size to reflect removal
+ * of header.
+ */
*p_size -= KS2_HS_SEC_HEADER_LEN;
+ memcpy(image, image + KS2_HS_SEC_HEADER_LEN, *p_size);
/*
* Output notification of successful authentication to re-assure the